// Copyright (c) 2021 - present core.ai . All rights reserved.
// Original work Copyright (c) 2014 - 2021 Adobe Systems Incorporated. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

// Style definitions are from
// https://github.com/chriskempson/tomorrow-theme/tree/master/Brackets

/*
 * Brackets Default Theme
 *
 * Defines all the variables that one can configure in a theme. This should
 * contain all variables / mixins for UI styling that we want to be able to
 * change in a theme.
 *
 * Throughout the rest of the LESS files we should _only_ use color
 * variable names that are on the LHS of the list below. So, if we
 * need a new color for some UI element, we should add a variable
 * in this file.
 */

/* Define some variables used in multiple places */
// This is the default theme. Only add code mirror editor surface related styles here.
// !!!!   for styling any other UI related styles, please use brackets_theme_default.less !!!!!!!!!!!!!!!!!!!!!!!

@background: #1d1f21;
@foreground: #ddd;
@accent-property: #ddd;
@accent-def: #b77fdb;
@accent-variable: #E387C1; // global var
@accent-variable-2: #b77fdb; // scoped var
@accent-variable-3: #535353; // type
@accent-string-2: #ffc641;
@accent-meta: #B39C1D;
@matching-bracket: #2e5c00;
@matching-tags: #000;
@matching-refs: #1D2951;

/* Code Styling */

.editor-text-fragment-matching-refs{
    background-color: @matching-refs;
}

.cm-atom, .cm-string, .cm-hr {color: #d89333;}
.cm-string-2, .cm-hr {color: @accent-string-2;}
.cm-number, .cm-attribute, .cm-plus {color: #85a300;}
.cm-def {color: @accent-def;}
.cm-property {color: @accent-property;}
.cm-variable {
    color: @accent-variable;
}
.cm-variable-2 {color: @accent-variable-2;}
.cm-variable-3 {color: @accent-variable-3;}
.cm-operator, .cm-bracket {color: @foreground;}
.cm-meta {color: @accent-meta;}
.cm-comment {color: #767676;}
.cm-minus {color: #dc322f;}
.cm-header {color: #d85896;}
.cm-link {color: #b77fdb; text-decoration: none;}
.cm-rangeinfo {color: #6c71c4;}
.cm-keyword, .cm-qualifier, .cm-builtin, .cm-tag, .cm-quote {color: #6c9ef8;}
.cm-error {color: #dc322f;}

/* Extra CSS */

.CodeMirror-searching {
    background-color: #d3cd69;
    &.searching-current-match {
        background-color: #f6a644;
    }
}

.CodeMirror-matchingbracket {
    /* Ensure visibility against gray inline editor background */
    background-color: @matching-bracket;
    color: @foreground !important;
}

.CodeMirror-matchingtag:not(.CodeMirror-searching) {
    /* Ensure visibility against gray inline editor background */
    background-color: @matching-tags;
    --border-height: calc((var(--editor-line-height) *1em - 1em) / 2);
    border-top: var(--border-height) solid @matching-tags;
    border-bottom: var(--border-height) solid @matching-tags;
}

.CodeMirror-overwrite .CodeMirror-cursor {
    border-left: none !important;
    border-bottom: 1px solid #fff;
}

.CodeMirror-foldgutter-open:after {
    color: #666;
}
.CodeMirror-foldgutter-folded:after {
    color: #aaa;
}

.CodeMirror.over-gutter, .CodeMirror-activeline {
    .CodeMirror-foldgutter-open:after {
        color: #ddd;
    }
}

.CodeMirror-foldmarker {
    border-color: #000;
    color: #ccc;
    background-color: #444;
}

/* Non-editor styling */

.image-view,
.not-editor {
    background-color: @background;
}

.view-pane .image-view {
    color: @foreground;
}
